package com.citycloud.ccuap.tc.admin;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jms.JmsProperties;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQProperties;
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.jms.annotation.EnableJms;

@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, JpaRepositoriesAutoConfiguration.class,
		MultipartAutoConfiguration.class })
@ServletComponentScan({ "com.citycloud.ccuap.commons.web.listener", "com.citycloud.ccuap.config",
		"com.citycloud.ccuap.tc.admin.filter" })
@ComponentScan(basePackages = "com.citycloud.ccuap")
@PropertySource(value = { "*:config/${spring.profiles.active}/global.properties",
		"*:config/${spring.profiles.active}/database.properties",
		"*:config/${spring.profiles.active}/activemq.properties",
		"*:config/${spring.profiles.active}/redis.properties",
		"*:config/${spring.profiles.active}/kafka.properties",
		"*:config/${spring.profiles.active}/oauth2.properties" }, ignoreResourceNotFound = true)
@EnableConfigurationProperties({ ActiveMQProperties.class, JmsProperties.class })
@EnableJms
@EnableFeignClients("com.citycloud.ccuap.tc.admin.feignclient")
public class MainApp extends SpringBootServletInitializer {
	public static void main(String[] args) {
		try {
			SpringApplication.run(MainApp.class, args);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
